package com.bkhc.business.api;

import com.bkhc.business.entity.vo.Order;
import com.bkhc.business.service.CommonService;
import com.bkhc.common.annotation.ApiOperation;
import com.bkhc.common.annotation.AuditLog;
import com.bkhc.common.enu.OperationEnum;
import com.bkhc.common.util.response.ResultJson;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;


/**
 * @author lx
 * @date 2021/6/20 17:58
 */

public class CommonController {

    private static Log log = LogFactory.getLog(CommonController.class);

    @Resource
    private CommonService commonService;

    /**
     * 查看产品价格表
     */
    @ApiOperation(code="queryProductPrice",name="查看产品价格表",description = "查看产品价格表")
    @AuditLog(object="BuinessPerson",operation = "查看产品价格表",type = OperationEnum.query)
    @RequestMapping(path = "/common/queryProductPrice/{pageNum}/{pageSize}",method = RequestMethod.GET)
    public ResultJson<?> queryProductPrice(@PathVariable(name="pageNum") int pageIndex, @PathVariable(name="pageSize") int pageSize) {
        ResultJson<?> res = commonService.queryProductPriceByVo(pageIndex,pageSize);
        return res;
    }

    /**
     * ????
     */
    @ApiOperation(code="queryOrderItem",name="????",description = "???????????")
    @AuditLog(object="BuinessPerson",operation = "????",type = OperationEnum.query)
    @RequestMapping(path = "/common/queryOrderItem/{pageNum}/{pageSize}",method = RequestMethod.GET)
    public ResultJson<?> queryOrderItem(@PathVariable(name="pageNum") int pageIndex, @PathVariable(name="pageSize") int pageSize, Order order) {
        ResultJson<?> res = commonService.queryOrderItem(pageIndex,pageSize,order);
        return res;
    }

}
